package com.service.impl;

import java.util.List;

import com.dao.TopicDao;
import com.dao.impl.TopicDaoImpl;
import com.entity.Topic;
import com.exception.DaoException;
import com.service.TopicService;

public class TopicServiceImpl implements TopicService {

	
	TopicDao topicDao = new TopicDaoImpl();
	
	
	@Override
	public List<Topic> selectTopics() throws DaoException{
		return topicDao.selectTopics();
	}


	@Override
	public boolean addTopic(String tname) throws DaoException {
		return topicDao.addTopic(tname);
	}


	@Override
	public boolean deleteTopic(Integer tid) throws DaoException {
		return topicDao.deleteTopic(tid);
	}


	@Override
	public Topic getTopic(Integer tid) throws DaoException {
		return topicDao.getTopic(tid);
	}


	@Override
	public boolean updateTopic(Integer tid, String tname) throws DaoException {
		return topicDao.updateTopic(tid, tname);
	}


	@Override
	public List<Topic> selectTopicsByPage(int page, int row) throws DaoException {
		return topicDao.selectTopicsByPage(page, row);
	}

}
